using System.Security.Principal;

namespace ASPNETVN.PORTAL.Components.Security
{
    public class PortalPrincipal : GenericPrincipal
    {
        public PortalPrincipal(IIdentity identity, string[] roles) : base(identity, roles)
        {
        }

        public new IdentityUser Identity
        {
            get
            {
                if (base.Identity is IdentityUser)
                {
                    return base.Identity as IdentityUser;
                }

                IdentityUser r = new IdentityUser(base.Identity.Name, "ASPNETVN.PORTAL");
                return r;
            }
        }
    }
}